import axios from 'axios'

const service = axios.create({
  baseURL: "http://localhost:8080",
  timeout: 5000 // request timeout
})

// 请求拦截器
service.interceptors.request.use(
  config => {
    config.headers.token = localStorage.getItem("token")
    return config
  }
)

// 响应拦截器
service.interceptors.response.use(
 
  response => {
    return response.data

  }
)

export default service
